#version 330 core
layout (location = 0) in vec3 pos;          // 位置坐标
layout (location = 1) in vec3 norm_vec;     // 法向量
layout (location = 2) in vec2 tex_cord;     // 纹理坐标
layout (location = 3) in mat4 inst_model_mats;

out vec4 scam_vtx_cord;
out vec3 vtx_cord;
out vec3 vtx_norm;
out vec2 vtx_tex_cord;
// out vec4 light_space_cord;

uniform vec2 use_nouse_instancing;
uniform mat4 model_mat;
uniform mat4 view_mat;
uniform mat4 proj_mat;
uniform mat4 scam_proj_mat;
uniform mat4 scam_view_mat;

void main() {
    mat4 final_model_mat = use_nouse_instancing[0] * inst_model_mats + use_nouse_instancing[1] * model_mat;
    vec4 cord = final_model_mat * vec4(pos, 1);
    vtx_cord = vec3(cord);
    gl_Position = proj_mat * view_mat * cord;
    vtx_norm = norm_vec;
    vtx_tex_cord = tex_cord;
    scam_vtx_cord = scam_proj_mat * scam_view_mat * cord;

    // gl_Position = vec4(pos.x, pos.z, 0.0, 1.0); 
}
